1. /* sdcmpi2.cpp by K.Tsuru */
  2. // function ID 3511 DRADIX, constant
  3. /********************************
  4. SDouble class
  5. pi/2
  6. Used in Asin(), etc.
  7. *********************************/
  8. #ifndef SN_H
  9. #include "sn.h"
  10. #endif
  11. static SDouble* mpi2 = NULL; //keep in the static memory
  12. static uint mpi2_size = 0;
  13. void MPi2Free(){ //free the memory of mpi2
  14. if(mpi2_size == 0) return;
  15. delete mpi2; mpi2 = NULL; mpi2_size = 0;
  16. }
  17. /* pi/2 */
  18. SDouble MPi2(){
  19. uint ms = SNManager::SNMaxSize(SNManager::REAL);
  20. if(mpi2_size < ms){
  21. if(mpi2 == NULL) mpi2 = new SDouble;
  22. SDouble pi = Pi();
  23. *mpi2 = DsDiv(pi, 2uL); // pi/2
  24. mpi2_size = ms;
  25. }
  26. return *mpi2;
  27. }

sdcmpi2.cpp : last modifiled at 2017/06/23 10:17:11(682 bytes)
created at 2017/10/07 10:21:15
The creation time of this html file is 2017/10/07 10:30:03 (Sat Oct 07 10:30:03 2017).